/**
 * Index Basic Http Request
 * 企业基本资料 Http 请求
 *
 * @date 2020-09-01
 * @author 逗号米
 */

import * as http from '@/http'
import * as api from '@/api/cms/company/company-basic'

/**
 * 首页
 *
 * @params {Object} [params] 参数
 * @return {Promise<any>}
 */
export const index = (params?: any): Promise<any> => http.get(api.index, params)

/**
 * 查询
 *
 * @params {Object} [params] 参数
 * @return {Promise<any>}
 */
export const query = (params?: any): Promise<any> => http.get(api.query, params)

/**
 * 显示
 *
 * @params {int} id 主键
 * @params {Object} [params] 参数
 * @return {Promise<any>}
 */
export const show = (id: number, params?: any): Promise<any> => http.get(api.show(id), params)

/**
 * 更新
 *
 * @params {int} id 主键
 * @params {Object} [params] 参数
 * @return {Promise<any>}
 */
export const update = (id: number, params?: any): Promise<any> => http.put(api.update(id), params)

/**
 * 删除
 *
 * @params {int} id 主键
 * @params {Object} [params] 参数
 * @return {Promise<any>}
 */
export const destroy = (id: number, params?: any): Promise<any> => http.del(api.destroy(id), params)

/**
 * 更新 logo
 *
 * @params {int} id 主键
 * @params {Object} params 参数
 * @return {Promise<any>}
 */
export const updateLogo = (id: number, params: any): Promise<any> => http.put(api.updateLogo(id), params)

/**
 * 删除 logo
 *
 * @params {int} id 主键
 * @return {Promise<any>}
 */
export const deleteLogo = (id: number): Promise<any> => http.del(api.deleteLogo(id))

/**
 * 更新 file
 *
 * @params {int} id 主键
 * @params {Object} params 参数
 * @return {Promise<any>}
 */
export const updateFile = (id: number, params: any): Promise<any> => http.put(api.updateFile(id), params)

/**
 * 删除 file
 *
 * @params {int} id 主键
 * @return {Promise<any>}
 */
export const deleteFile = (id: number): Promise<any> => http.del(api.deleteFile(id))